﻿<%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="Forecast.aspx.cs" Inherits="Sales_Forecast" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phMain" Runat="Server">
<fieldset style="margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px;">
        <legend>搜索条件</legend>地区：
        <asp:DropDownList ID="ddlRegion" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource2" DataTextField="RegionName" DataValueField="RegionID">
        </asp:DropDownList>
        餐厅：
        <asp:DropDownList ID="ddlStore" runat="server" DataSourceID="ObjectDataSource1" DataTextField="StoreName" DataValueField="StoreID">
        </asp:DropDownList>
        营运日期：
        <asp:TextBox ID="txtBeginDate" runat="server"></asp:TextBox>
        <asp:RangeValidator ID="RangeValidator1" runat="server" Display="Dynamic" ErrorMessage="*必须为2000-1-1至2100-1-1"
            ControlToValidate="txtBeginDate" MaximumValue="2100-1-1" MinimumValue="2000-1-1"
            SetFocusOnError="True" Type="Date"></asp:RangeValidator>至：<asp:TextBox ID="txtEndDate"
                runat="server"></asp:TextBox>
        <asp:RangeValidator ID="RangeValidator2" runat="server" Display="Dynamic" ErrorMessage="*必须为2000-1-1至2100-1-1"
            ControlToValidate="txtEndDate" MaximumValue="2100-1-1" MinimumValue="2000-1-1"
            SetFocusOnError="True" Type="Date"></asp:RangeValidator>
            <asp:Button ID="btnQuery" Text="查询" runat="server" />
    </fieldset>
    <fieldset style="margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px;">
    <asp:GridView ID="GridView1" runat="server" BorderWidth="1px" EmptyDataText="找不到批配的数据"
        HorizontalAlign="Center" Width="100%" AutoGenerateColumns="False"  AllowPaging="True" DataSourceID="ObjectDataSource3">
        <EmptyDataRowStyle BackColor="#0000C0" Font-Bold="True" Font-Size="12pt" ForeColor="White" />
        <HeaderStyle BackColor="Gray" />
        <AlternatingRowStyle BackColor="#E0E0E0" />
        <EditRowStyle ForeColor="White" />
        <Columns>
            <asp:BoundField DataField="StoreID" HeaderText="餐厅编号" SortExpression="StoreID" />
            <asp:BoundField DataField="StoreName" HeaderText="餐厅名称" SortExpression="StoreName" />
            <asp:BoundField DataField="OperationDate" HeaderText="营运日期" SortExpression="OperationDate" />
            <asp:BoundField DataField="BudgetSales" HeaderText="预算Sales" SortExpression="BudgetSales" />
            <asp:BoundField DataField="BudgetTC" HeaderText="预算TC" SortExpression="BudgetTC" />
            <asp:BoundField DataField="TargetSales" HeaderText="目标Sales" SortExpression="TargetSales" />
            <asp:BoundField DataField="TargetTC" HeaderText="目标TC" SortExpression="TargetTC" />
            <asp:BoundField DataField="TargetDinnerSales" HeaderText="目标堂食Sales" SortExpression="TargetDinnerSales" />
            <asp:BoundField DataField="TargetDinnerTC" HeaderText="目标堂食TC" SortExpression="TargetDinnerTC" />
            <asp:BoundField DataField="TargetTakeAwaySales" HeaderText="目标外带Sales" SortExpression="TargetTakeAwaySales" />
            <asp:BoundField DataField="TargetTakeAwayTC" HeaderText="目标外带TC" SortExpression="TargetTakeAwayTC" />
            <asp:BoundField DataField="TargetDeliverySales" HeaderText="目标外送Sales" SortExpression="TargetDeliverySales" />
            <asp:BoundField DataField="TargetDeliveryTC" HeaderText="目标外送TC" SortExpression="TargetDeliveryTC" />
            <asp:BoundField DataField="TargetLaborHour" HeaderText="目标工时" SortExpression="TargetLaborHour" />
            <asp:BoundField DataField="TargetWater" HeaderText="目标Water" SortExpression="TargetWater" />
            <asp:BoundField DataField="TargetElectricity" HeaderText="目标Electricity" SortExpression="TargetElectricity" />
            <asp:BoundField DataField="TargetGas" HeaderText="目标Gas" SortExpression="TargetGas" />
        </Columns>
    </asp:GridView>
    </fieldset>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetStoresByRegionID"
        TypeName="BaseInfoDB">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlRegion" Name="RegionID" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetRegions"
        TypeName="BaseInfoDB"></asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="getForecastByCondition"
        TypeName="Inventory">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlRegion" Name="RegionID" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:ControlParameter ControlID="ddlStore" Name="StoreID" PropertyName="SelectedValue"
                Type="String" />
            <asp:ControlParameter ControlID="txtBeginDate" Name="beginDate" PropertyName="Text"
                Type="DateTime" />
            <asp:ControlParameter ControlID="txtEndDate" Name="endDate" PropertyName="Text" Type="DateTime" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

